package work.xiaohong.mina.utils;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author Kevin
 * @data 4/23/2022 9:14 PM
 * @description 线程安全的计数器
 **/
public class CountUtil {

  private static AtomicInteger sequence = new AtomicInteger();

  /**
   * 每获得一次便增加1
   * @return
   */
  public static Integer getSequence() {
    Integer result = sequence.get();
    sequence.incrementAndGet();
    return result;
  }

}
